package com.huawei.appmarket.service.substance;

import android.view.View;
import android.widget.AbsListView;
import com.huawei.appgallery.foundation.service.common.protocol.AppListFragmentProtocol;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import java.util.List;
import o.chz;
import o.CollectCheck;

public class WideSubstanceDetailFragment extends BaseSubstanceDetailFragment<AppListFragmentProtocol> {
    private int ᐝ = -100;

    protected void ߺ() {
        super.ߺ();
        if (this.ˊ != null && ˊʻ()) {
            this.ˊ.post(new Runnable(this) {
                final /* synthetic */ WideSubstanceDetailFragment ˎ;

                {
                    this.ˎ = r1;
                }

                public void run() {
                    if (this.ˎ.ͺˎ != null) {
                        int firstVisiblePosition = this.ˎ.ͺˎ.getFirstVisiblePosition();
                        int childCount = this.ˎ.ͺˎ.getChildCount();
                        if (this.ˎ.ᐝ < firstVisiblePosition || this.ˎ.ᐝ >= firstVisiblePosition + childCount) {
                            this.ˎ.ˊ.setVisibility(0);
                        } else {
                            this.ˎ.ˊ.setVisibility(8);
                        }
                    }
                }
            });
        }
    }

    protected void ॱ(View view) {
    }

    protected boolean ˊʻ() {
        return this.ᐝ >= 0 || !(this.י == null || CollectCheck.isEmpty(ٴ()));
    }

    public List<CardBean> ٴ() {
        if (this.י == null) {
            return null;
        }
        List ʻॱ = this.י.ʻॱ();
        if (CollectCheck.isEmpty(ʻॱ)) {
            return null;
        }
        for (int i = 0; i < ʻॱ.size(); i++) {
            if ("substancehostappcard".equals(((chz) ʻॱ.get(i)).ˏॱ())) {
                this.ᐝ = i;
                return ((chz) ʻॱ.get(i)).ˏ();
            }
        }
        return null;
    }

    protected void י() {
    }

    public void ˏͺ() {
        if (this.ˊ != null) {
            this.ˊ.ˋ();
        }
    }

    public void onScroll(AbsListView absListView, int i, int i2, int i3) {
        super.onScroll(absListView, i, i2, i3);
        if (ˊʻ() && this.ˊ != null) {
            if (this.ᐝ < i || this.ᐝ >= i + i2) {
                this.ˊ.setVisibility(0);
            } else {
                this.ˊ.setVisibility(8);
            }
        }
    }
}
